//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================

namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;
    using App.Model;

    public class GetTraining {
        private readonly ITrainingRepository _trainingRepository;

        public GetTraining(ITrainingRepository trainingRepository) {
            _trainingRepository = trainingRepository;
        }

        public Training Execute(Guid trainingId) {
            try {
                return _trainingRepository.GetTraining(trainingId);
            }
            catch (InvalidOperationException ex) {
                throw new BusinessServicesException("UnableToRetrieveReminderExceptionMessage", ex);
            }
        }
    }
}
